From 5cafa2b1ce1ee38c8f3bb1befeed98ae55dcc923 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Timm=20B=C3=A4der?= Date: Thu, 3 Aug 2017 11:14:53 +0200 Subject: [PATCH] entry: get_icon_area returns in entry coordinates This fixes the popover positions in the gtk4-demo/popovers, and it also just makes sense. Also document what the returned coordinates are relatiev to. --- gtk/gtkentry.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c index 1d8223a3d9..b33f4fdced 100644 --- a/gtk/gtkentry.c +++ b/gtk/gtkentry.c @@ -8044,7 +8044,8 @@ gtk_entry_get_current_icon_drag_source (GtkEntry *entry) * entry in a draw callback. * * If the entry is not realized or has no icon at the given position, - * @icon_area is filled with zeros. + * @icon_area is filled with zeros. Otherwise, @icon_area will be filled + * with the icon's allocation, relative to @entry's allocation. * * See also gtk_entry_get_text_area() * @@ -8067,11 +8068,7 @@ gtk_entry_get_icon_area (GtkEntry *entry, if (icon_info) { - GtkAllocation widget_allocation; - gtk_widget_get_allocation (GTK_WIDGET (entry), &widget_allocation); - gtk_widget_get_border_allocation (icon_info->widget, icon_area); - icon_area->x -= widget_allocation.x; - icon_area->y -= widget_allocation.y; + gtk_widget_get_outer_allocation (icon_info->widget, icon_area); } else { -- 2.30.2